package com.woniuxy.activiti.controller;

import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录请求
 * @author xilei
 * @create 2021--13 11:45
 */

@RestController
public class LoginController {

    /**
     * 获取用户登录名
     * @return
     */
    @GetMapping("/login/username")
    public String getUserName(){
        String name = SecurityContextHolder.getContext().getAuthentication().getName();
        System.out.println(name);
        return name;
    }
}
